/****************************************************
 * 													*
 * 					BanzaiP2P						*
 * 													*
 * Versione: 0.1.1									*
 * Autore: D'Annessa Marco							*
 * File: console.c									*
 ****************************************************/

#include "console.h"

void logo_console(){
	
	
	printf("\n*************************************************\n");
	printf("*************************************************\n");
	printf("******************* \e[3;31mBanzaiP2P \e[00m*******************\n");
	printf("*************************************************\n");
	printf("*************************************************\n\n");
	

};

void menu_console(){
	
	printf("\n\n\tBanzaiP2P MENU' \n");
	printf("-----------------------------------\e[00m\n");
	printf("\e[3;32m 1 = CONNECT TO BanzaiNet\e[00m\n");
	printf("\e[3;33m 2 = SHOW SHARED FILES\e[00m\n");
	printf("\e[2;34m 3 = SEARCH FILE\e[00m\n");
	printf("\e[2;35m 4 = DOWNLOAD FILELIST\e[00m\n");
	printf("\e[2;36m 5 = OPZIONI\e[00m\n");
	printf("\e[2;37m 6 = DISCONNECT FROM BanzaiP2P\e[00m\n");
	printf("-----------------------------------\n\n");
	
};


void opt_menu_console(){
	
	
};

void file_list_console(struct file_list *f){
	

	printf("\n\n %-45s      ","           NAME");
	printf("%-8s   |   ","   SIZE");
	printf("%s","    LAST MODIFY\n");
	printf("----------------------------------------------------------------------------------------------\n");
	while(f->next!=NULL){
		printf("\n %-45s      ",f->file->name);
		//printf("Cpath: %s\n",f->file->path);
		printf("%-6d%s      ",(f->file->size/1024),"Kb");
		printf("%s",ctime(&f->file->last_mod));

		f=f->next;
	}
	printf("----------------------------------------------------------------------------------------------\n\n");
	
	
}